<div class="returnGoods" ng-controller="returnGoods">
	
	<section class="header">
		<form class="form-inline">
			<div class="form-group">
				<label>销售单号：</label>
				<input type="text" class="form-control" ng-model="saleOrderNo">
			</div>
			<button type="submit" class="btn btn-default" ng-click="searchItemBySaleOrderNo()">查询订单</button>
		</form>
	</section>

	<section class="result table-responsive">
		<table class="table table-bordered table-hover" ng-show="returnGoodsItem.length !== 0">
			<tr>
				<th>#</th>
				<th>条形码</th>
				<th>名称</th>
				<th>颜色</th>
				<th>尺寸</th>
				<th>款式</th>
				<th>单价</th>
				<th>数量</th>
				<th>金额</th>
				<th>退货</th>
			</tr>
			<tr ng-repeat="item in returnGoodsItem">
				<td>{{$index+1}}</td>
				<td>{{item.barcode}}</td>
				<td>{{item.name}}</td>
				<td>{{item.color}}</td>
				<td>{{item.size}}</td>
				<td>{{item.style}}</td>
				<td>{{item.salePrice}}</td>
				<td>{{item.quantity}}</td>
				<td>{{item.subTotal}}</td>
				<td class="return">
					<button class="btn btn-warning" ng-click="addToList(item)">添加到退货列表（+ 1）</button>
				</td>
			</tr>
		</table>
	</section>

	<section class="returnGoodsList" ng-show="returnGoodsList.length !== 0">
		<h3>退货列表：</h3>
		<ul>
			<li>
				<span class="spanWid1">#</span>
				<span class="spanWid2">条形码</span>
				<span class="spanWid3">名称</span>
				<span>颜色</span>
				<span>尺寸</span>
				<span>款式</span>
				<span>单价</span>
				<span>退货数量</span>
				<span>返还金额</span>
				<span>取消（-1）</span>
			</li>
			<li ng-repeat="item in returnGoodsList">
				<span class="spanWid1">{{$index+1}}</span>
				<span class="spanWid2">{{item.barcode}}</span>
				<span class="spanWid3">{{item.name}}</span>
				<span>{{item.color}}</span>
				<span>{{item.size}}</span>
				<span>{{item.style}}</span>
				<span>{{item.salePrice}}</span>
				<span>{{item.returnQuantity}}</span>
				<span>{{item.returnSubTotal}}</span>
				<span><button type="button" class="btn btn-info" ng-click="deleteFromList(item, $index)"><i class="fa fa-minus-circle"></i></button></span>
			</li>
		</ul>
		<div class="settlement">
			<span>合计：</span><span>{{total}}</span><span>￥</span>
			<br>
			<button type="button" class="btn btn-danger" ng-click="processReturns()">确定退货</button>
		</div>
	</section>

</div>